<form action="<?php echo $webroot?>Point_of_sale/edit_item/6" id="refund_form" method="post">
<table id="register">
		<thead>
			<tr>
				<th id="reg_item_name">Item Name</th>
				<th id="reg_item_number">Brand</th>
				<th id="reg_item_price">Price</th>
				<th id="reg_item_discount">Discount</th>
				<th id="reg_item_total">Total</th>
				<th id="reg_item_option">&nbsp;</th>
			</tr>
		</thead>
		<tbody id="cart_contents">
		<?php if(empty($items)){?>
			<tr>
				<td colspan="6">
					<div class="warning_message" style="padding:7px;">There are no items in the cart</div>
				</td>
			</tr>
			<?php }else{?>
			<?php foreach($items as $k=>$v){?>
					<tr data-id="<?php echo $v["Item"]["id"]?>" class="<?php echo empty($v["Item"]["status"])?"":"disabled"?>">
						<td id="reg_item_name"><?php echo $v["Item"]["name"]?></td>
						<td id="reg_item_number"><?php echo $v["Brand"]["name"]?></td>
						<td id="reg_item_price" ><?php echo $v["Item"]["original_price"]?></td>
						<td id="reg_item_discount"><?php echo empty($v["Item"]["discount_type"])?"%":"$"?> <?php echo $v["Item"]["discount"]?></td>
						<td id="reg_item_total">$<?php echo $v["Item"]["total"]?></td>
						<td id="reg_item_option">
						<?php if(empty($v["Item"]["status"])){?>
						<a class="btn sale_item_refund" href="javascript:;">Refund</a>
						<?php }else{?>
						<a class="btn" href="javascript:;">Refunded</a>
						<?php }?>
						</td>
					</tr>
			<?php } }?>
		</tbody>
</table>
<input type="hidden" name="sale_id" value="<?php echo $sale_id?>"/>
<input type="hidden" name="item_id" value=""/>
</form>
<script type="text/javascript">
	$(document).ready(function(){
		//item项，点击退货，直接因影响到最后的金额
		$(".sale_item_refund").click(function(){
			//标记需要退货
			$(this).parent().parent().toggleClass("refunded");;
			return false;
		});
	});
</script>
